﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ABC_SA_DM;
using System.Data;
using System.Diagnostics;
namespace ABC_SA_DAL
{
    public class Factura_DAL
    {
       // Convert.ToDateTime(DateTime.Today.ToShortDateString()).ToString(@"dd-MM-yyyy")

        public Int32 crear(Factura factura) {

            Cliente_DAL clienteDAL = new Cliente_DAL();

            string sql = "INSERT INTO FACTURA(FECHA_TRANS, MONTO, ID_CLIENTE) VALUES('" + DateTime.Today.ToString(@"yyyy-MM-dd") + "', "
                + factura.montoFinal + ", "
                + clienteDAL.consultaIdCliente(factura.cliente.UserName).IdCliente + ") SELECT SCOPE_IDENTITY()";

            return DBComma.CommandEjecutarScalar(sql);
        
        }



    }
}
